Conditional logic and loops
Conditional logic lets users define actions that execute when specific conditions are met, enhancing efficiency through automation. Users can integrate if-else, while, and loop statements into test scripts using Selenium, JavaScript, and standard steps.
When "Add Conditional Loop Steps" icon is clicked, a pop-up window appears, allowing users to select the desired conditional statements.
If-Else Condition:
The "if" statement evaluates a condition, executing the steps within its block only if the condition is true and else part won’t execute. Steps specified under the "else" block should execute when if condition is false.
When adding an if-else condition, users can choose between JavaScript or Selenium scripts, each opening a dedicated scripting window upon selection. Predefined scripts are available in presets, allowing for easy use and direct integration into workflows.
In the reports section, the if-else condition will be displayed as shown in the accompanying image. Here when an “if” condition is passed, the “else” condition will be marked as "not executed". This provides clear visibility into the flow of conditional logic within workflows. For normal steps the “if “condition will be displayed in reports section but for steps having JavaScript or Selenium scripts then it will not be displayed